package com.huawei.chengdu.meetingdemo.view.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.huawei.chengdu.meetingdemo.R;
import com.huawei.chengdu.meetingdemo.presenter.ConfSdkPresenter;

public class StartCallDialog extends Dialog {
    private TextView callNumView;
    private Button buttonCancel;

    public StartCallDialog(@NonNull Context context, String callNumber) {
        super(context);
        setContentView(R.layout.dialog_start_call);
        callNumView = findViewById(R.id.call_number);
        callNumView.setText(callNumber);
        buttonCancel = findViewById(R.id.button_cancel);
        initListener();
    }

    @Override
    public void show() {
        setCanceledOnTouchOutside(false);
        super.show();
    }

    private void initListener() {
        buttonCancel.setOnClickListener((v -> {
            ConfSdkPresenter.cancelCall();
            dismiss();
        }));
    }
}
